package com.nlx.notes.module.bean.vo;

import com.nlx.notes.module.bean.BaseVo;
import com.nlx.notes.module.core.consts.ErrorCodeConst;
import lombok.*;

import java.util.List;

@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class PageResultVo<T> extends ResultBaseVO {

    private Pagination page;

    private List<T> data;

    public  static <T>  PageResultVo<T> success(Pagination page, List<T> data) {
        PageResultVo<T> resultVo = new PageResultVo<>(page, data);
        resultVo.setCode(ErrorCodeConst.FLOW_ERROR_CODE_SUFFIX);
        resultVo.setMsg("success");
        return resultVo;
    }
}
